package dnl.utils.mail;

import org.jasypt.util.text.BasicTextEncryptor;

public class EncryptionUtil {

	public static void main(String[] args) {

//		String ENCRYPTOR_PASSWORD = "V5a4l3i2r1e";
//		BasicTextEncryptor encryptor = new BasicTextEncryptor();
//		encryptor.setPassword(ENCRYPTOR_PASSWORD);
//		String decrypted = encryptor.decrypt("v01AB3koWvsMvG+KLbJJEA==");
//		System.out.println(decrypted);
		System.out.println(encrypt("D5a4n3i2e1l", "col123"));
	}
	
	public static String encrypt(String encpass, String text){
		BasicTextEncryptor encryptor = new BasicTextEncryptor();
		encryptor.setPassword(encpass);
		return encryptor.encrypt(text);
	}

	public static String decrypt(String encpass, String text){
		BasicTextEncryptor encryptor = new BasicTextEncryptor();
		encryptor.setPassword(encpass);
		return encryptor.decrypt(text);
	}
	
}
